/*******************************************************************************
    Copyright 2006 Michael Welch
    
    This file is part of MBasic99.

    MBasic99 is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    MBasic99 is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with MBasic99; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*******************************************************************************/


using System;
using System.Collections.Generic;
using System.Text;

namespace mbasic.SyntaxTree
{
    abstract class Expression : Node
    {
        public abstract BasicType GetBasicType();

        protected Expression(LineId line) : base(line) { }

        protected void TypeMismtach()
        {
            string msg = String.Format("Type Mismatch On {0}", line.Label);
            throw new Exception(msg);
        }

        protected static bool TypeIsNotNumeric(BasicType type)
        {
            if (type != BasicType.Number && type != BasicType.Boolean) return true;
            return false;
        }

    }
}
